package com.wjv.example.springboot.base.config.autoconfig;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * <p>Title: MyConfigProperty</p>
 *
 * @author wjv
 * @since 2021/8/25 10:15
 */
@Data
@Component
@ConfigurationProperties(prefix = MyConfigProperty.PREFIX)
@ConditionalOnProperty(prefix = MyConfigProperty.PREFIX, name = "enabled", havingValue = "true", matchIfMissing = true)
public class MyConfigProperty implements Serializable {
    public static final String PREFIX = "my-config";

    /**
     * 注释 name
     */
    private String name;

    /**
     * 注释 password
     */
    private String password;

}
